package com.zhuang.designpattern.abstractfactory.optimize;

import com.zhuang.designpattern.abstractfactory.optimize.factory.JDKProxy;
import com.zhuang.designpattern.abstractfactory.optimize.factory.impl.EGMCacheAdapter;
import com.zhuang.designpattern.abstractfactory.optimize.factory.impl.IIRCacheAdapter;
import com.zhuang.designpattern.abstractfactory.optimize.impl.CacheServiceImpl;

/**
 * description: Test
 * date: 2022/9/10 16:59
 * author: Zhuang
 * version: 1.0
 */
public class Test {
    public static void main(String[] args) throws Exception {
        CacheService proxy_EGM = JDKProxy.getProxy(CacheServiceImpl.class, new EGMCacheAdapter());
        proxy_EGM.set("user_name_01", "康小庄");
        String val01 = proxy_EGM.get("user_name_01");
        System.out.println(val01);

        CacheService proxy_IIR = JDKProxy.getProxy(CacheServiceImpl.class, new IIRCacheAdapter());
        proxy_IIR.set("user_name_01", "康小庄");
        String val02 = proxy_IIR.get("user_name_01");
        System.out.println(val02);
    }
}
